/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1a1a1a;
    color: #ffffff;
    line-height: 1.6;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    border-bottom: 1px solid #333;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ff6b6b;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

/* 按钮样式 */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #ff5252, #e53935);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.btn-secondary {
    background: #333;
    color: white;
    border: 1px solid #555;
}

.btn-secondary:hover {
    background: #444;
    border-color: #666;
}

.btn-outline {
    background: transparent;
    color: #ff6b6b;
    border: 1px solid #ff6b6b;
}

.btn-outline:hover {
    background: rgba(255, 107, 107, 0.1);
}

/* 筛选区域样式 */
.filters-section {
    background: #2d2d2d;
    padding: 1.5rem 1rem;
    border-bottom: 1px solid #333;
}

.search-box {
    max-width: 600px;
    margin: 0 auto 1rem;
    display: flex;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #555;
    border-radius: 4px;
    background: #1a1a1a;
    color: white;
    font-size: 1rem;
}

.search-input:focus {
    outline: none;
    border-color: #ff6b6b;
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.2);
}

.search-btn {
    padding: 0.75rem 1.5rem;
    background: #ff6b6b;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-btn:hover {
    background: #ff5252;
}

.filter-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.5rem 1rem;
    border: 1px solid #555;
    border-radius: 4px;
    background: #1a1a1a;
    color: white;
    min-width: 120px;
}

/* 主要内容区域 */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    width: 100%;
}

/* 视频网格样式 */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.video-card {
    background: #2d2d2d;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #333;
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: #ff6b6b;
}

.video-thumbnail {
    width: 100%;
    height: 160px;
    background: linear-gradient(135deg, #333, #555);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.video-thumbnail::before {
    content: '▶';
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.7);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.video-info {
    padding: 1rem;
}

.video-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: white;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: #aaa;
}

.video-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.tag {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
}

.video-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.action-btn {
    padding: 0.25rem 0.5rem;
    border: none;
    border-radius: 4px;
    background: #333;
    color: #aaa;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: #444;
    color: white;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 3rem;
    color: #aaa;
    font-size: 1.1rem;
    grid-column: 1 / -1;
}

.load-more {
    text-align: center;
    padding: 2rem 0;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: #2d2d2d;
    margin: 2% auto;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: white;
    margin: 0;
}

.close {
    color: #aaa;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: white;
}

.modal-body {
    padding: 1.5rem;
}

/* 视频播放器样式 */
#videoPlayer {
    width: 100%;
    max-height: 60vh;
    border-radius: 4px;
    background: #000;
}

.video-info {
    margin-top: 1rem;
    padding: 1rem;
    background: #333;
    border-radius: 4px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
}

.info-label {
    color: #aaa;
    font-weight: bold;
}

/* 表单样式 */
.edit-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    color: #aaa;
    font-weight: bold;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid #555;
    border-radius: 4px;
    background: #1a1a1a;
    color: white;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ff6b6b;
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.2);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* 扫描进度样式 */
.scan-progress {
    text-align: center;
    margin-bottom: 1.5rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #333;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #ff5252);
    width: 0%;
    transition: width 0.3s ease;
}

.scan-status {
    color: #aaa;
    font-size: 0.9rem;
}

.scan-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }

    .filter-controls {
        flex-direction: column;
        align-items: center;
    }

    .filter-select {
        width: 100%;
        max-width: 200px;
    }

    .modal-content {
        margin: 5% auto;
        width: 95%;
    }

    .form-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .video-grid {
        grid-template-columns: 1fr;
    }

    .search-box {
        flex-direction: column;
    }

    .search-btn {
        width: 100%;
    }
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
    grid-column: 1 / -1;
}

.empty-state h3 {
    margin-bottom: 1rem;
    color: #aaa;
}

/* 评分星星样式 */
.rating-stars {
    color: #ffd700;
    font-size: 0.9rem;
}

/* 文件大小格式化 */
.file-size {
    font-family: monospace;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-size: 0.8rem;
}

/* 目录选择样式 */
.directory-selection {
    margin-bottom: 1.5rem;
}

.directory-input-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.directory-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #555;
    border-radius: 4px;
    background: #1a1a1a;
    color: white;
    font-size: 1rem;
}

.directory-input:focus {
    outline: none;
    border-color: #ff6b6b;
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.2);
}

.directory-example {
    margin-top: 0.5rem;
    color: #666;
    font-size: 0.85rem;
}